export default {
  NAME: 'name' as keyof QA.UserInitBasic,
  NUM: 'num' as keyof QA.UserInitBasic,
  GENDER: 'gender' as keyof QA.UserInitBasic,
  MARITAL_STATUS: 'maritalStatus' as keyof QA.UserInitBasic,
  CHILDREN_SITUATION: 'childrenSituation' as keyof QA.UserInitBasic,
  AGE: 'age' as keyof QA.UserInitBasic,
  EDUCATION: 'education' as keyof QA.UserInitBasic,
  JOB_POSITION: 'jobPosition' as keyof QA.UserInitBasic,
  AFFILIATED: 'affiliated' as keyof QA.UserInitBasic,
  WORK_UNIT: 'workUnit' as keyof QA.UserInitBasic,
  OPERATING_POST: 'operatingPost' as keyof QA.UserInitBasic,
  EMAIL: 'email' as keyof QA.UserInitBasic
};

/**
 * 是否是value值为string类型的属性名
 * @param key 属性名
 * @returns boolean
 */
export function isUserBasicStringInfo(
  key: keyof QA.UserInitBasic,
): key is QA.UserBasicStringKey {
  return key === 'affiliated' || key === 'workUnit'
    || key === 'jobPosition' || key === 'operatingPost'
    || key === 'email' || key === 'name' || key === 'num';
}

/**
 * 是否是value值为number类型的属性名
 * @param key 属性名
 * @returns boolean
 */
export function isUserBasicNumberInfo(
  key: keyof QA.UserInitBasic,
): key is QA.UserBasicNumberKey {
  return key === 'gender' || key === 'maritalStatus'
    || key === 'childrenSituation' || key === 'age' || key === 'education';
}
